#include		"RssContent.hpp"
#include		"XmlParser.hpp"
#include		"RssItem.hpp"
#include		<fstream>
#include <iostream>
using namespace std;

int				main()
{
	string		content;
	ifstream				myFile("flux.xml");

	int length = 0;
	myFile.seekg( 0 , std::ios_base::end );
    length = myFile.tellg() ;
    myFile.seekg( 0,  std::ios_base::beg ) ;
	content.resize(length);
	myFile.read((char *)content.c_str(), length);


	RssContent	test(content);

	vector<RssItem*>::const_iterator it = test.getArticleList().begin();
	vector<RssItem*>::const_iterator ite = test.getArticleList().end();

	while (it != ite)
	{
		cout << "Titre: " << (*it)->getTitle() << endl;
		cout << "Autor: " << (*it)->getAutor() << endl;
		cout << "Categorie: " << (*it)->getCategorie() << endl;
		cout << "Description: " << (*it)->getDescription() << endl;
		cout << "Guid: " << (*it)->getGuid() << endl;
		cout << "Link: " << (*it)->getLink() << endl;
		cout << "PubDate: " << (*it)->getPubDate() << endl;
		++it;
	}
	cout << "XmlVersion: " << test.getXmlVersion() << endl;	
	cout << "RssVersion: " << test.getRssVersion() << endl;	
	cout << "RssTitle: " << test.getRssTitle() << endl;
	cout << "RssLink: " << test.getRssLink() << endl;
	cout << "RssDescription: " << test.getRssDescription() << endl;
	cout << "RssLanguage: " << test.getRssLanguage() << endl;
	cout << "RssCopyriht: " << test.getRssCopyright() << endl;
	cout << "RssPubDate: " << test.getRssPubDate() << endl;
//	system("PAUSE");
	char c;
	cin >> c;
	return (0);
}